%Declare the symbolic variables (syms)
syms NVal WrVal YVal
f=phi/(1-N*exp(NVal))-Wr*exp(WrVal)/(Y*exp(YVal));

%Take symbolic derivatives
dd1 = diff(f,NVal);
dd2 = diff(f,WrVal);
dd3 = diff(f,YVal);

%Evaluates symbolic derivatives

NVal=0;  %loglin
WrVal=0;  %loglin
YVal=0;  %loglin


D1=subs(dd1);
D2=subs(dd2);
D3=subs(dd3);

% Transform symbolic into numbers (with double precision)
d1=double(D1);
d2=double(D2);
d3=double(D3);

ACont(ii,NcLog)        = d1;
ACont(ii,WrcLog)       = d2;
ACont(ii,YcLog)        = d3;
